package com.microservice.api.user.dto;

import com.microservice.api.auth.dto.LoginResponse;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

/**
 * 登录响应DTO
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LoginResponseDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    
    /**
     * 访问令牌
     */
    private String accessToken;
    
    /**
     * 刷新令牌
     */
    private String refreshToken;
    
    /**
     * 令牌类型
     */
    private String tokenType = "Bearer";
    
    /**
     * 过期时间（秒）
     */
    private Long expiresIn;
    
    /**
     * 用户信息
     */
    private UserInfoDTO userInfo;
    
    /**
     * 用户角色列表
     */
    private Set<String> roles;
    
    /**
     * 用户权限列表
     */
    private Set<String> permissions;
    
    /**
     * 用户菜单树
     */
    private List<LoginResponse.MenuVO> menus;
    
    public LoginResponseDTO(String accessToken, String refreshToken, Long expiresIn, UserInfoDTO userInfo) {
        this.accessToken = accessToken;
        this.refreshToken = refreshToken;
        this.expiresIn = expiresIn;
        this.userInfo = userInfo;
    }
}
